<template>
    <div class="wrapper">
        <el-divider content-position="center">其他登录方式</el-divider>
        <div class="selection">
            <el-space wrap :size="25">
                <div @click="handleLogin('Gitee')">
                    <IconPlus name="gitee" :size="32" class="icon"></IconPlus>
                </div>
            </el-space>
        </div>
    </div>
</template>
<script setup>
import { getAuthurl } from "@/api/oauth/socialoauth"
const handleLogin = (provider) => {
    let callbackUrl = `/oauth/callback?op=login&provider=${provider}`
    getAuthurl({ provider, redirectUrl: callbackUrl }).then(res => {
        window.location.href = res;
    })
    // TODO: Implement github login logic here
}

defineExpose({ login: handleLogin })

</script>
<style lang="scss" scoped>
.selection {
    padding-bottom: 10px;

    .icon {
        cursor: pointer;
        width: 25px;
        height: 25px;
    }
}
</style>